<?php
/**
 * Created by PhpStorm.
 * User: Inhere
 * Date: 2015/2/27
 * Use : 信息
 * File: AbstructEnv.php
 */

namespace ulue\core\environment;

use ulue\libs\datastorage\SimpleDatastorage;

abstract class AbstractEnv extends SimpleDatastorage
{
    /**
     * data storge
     * @var array
     */
    protected $data = [];

    /**
     * @var array
     */
    static public $config = [];

    public function __construct()
    {
        $this->init();
    }

    /**
     * 初始化信息
     */
    public function init()
    {
        foreach (static::$config as $name => $realName) {
            $this->data[$name] = isset($_SERVER[$realName]) ? trim($_SERVER[$realName]) : null;
        }
    }

}